package net.easyjava.third.search.elastic;

import net.easyjava.tools.BaseBean;

import java.util.Map;

/**
 * Created by wxnacy on 16/7/7.
 */
public  class  ESearchConfig extends BaseBean {
    private static final long serialVersionUID = -2636577649001186588L;
    private String index;
    private String[] types;
    private SearchType searchType;
    private String query;
    private String[] queryFields;
    private String rangeField;
    private Object rangeFrom;
    private Object rangeTo;
    private int pageNum;
    private int pageSize;

    /**
     * 搜索类型的枚举
     */
    enum SearchType{
        QUERY_ALL,QUERY_FIELD,RANGE
        ;
    }

    public ESearchConfig(String index, String[] types) {
        this.index = index;
        this.types = types;
    }

    public String[] getQueryFields() {
        return queryFields;
    }

    public void setQueryFields(String[] queryFields) {
        this.queryFields = queryFields;
    }

    public String getRangeField() {
        return rangeField;
    }

    public void setRangeField(String rangeField) {
        this.rangeField = rangeField;
    }

    public SearchType getSearchType() {
        return searchType;
    }

    public void setSearchType(SearchType searchType) {
        this.searchType = searchType;
    }

    public String getIndex() {
        return index;
    }

    public void setIndex(String index) {
        this.index = index;
    }

    public String[] getTypes() {
        return types;
    }

    public void setTypes(String[] types) {
        this.types = types;
    }

    public String getQuery() {
        return query;
    }

    public void setQuery(String query) {
        this.query = query;
    }


    public Object getRangeFrom() {
        return rangeFrom;
    }

    public void setRangeFrom(Object rangeFrom) {
        this.rangeFrom = rangeFrom;
    }

    public Object getRangeTo() {
        return rangeTo;
    }

    public void setRangeTo(Object rangeTo) {
        this.rangeTo = rangeTo;
    }

    public int getPageNum() {
        return pageNum;
    }

    public void setPageNum(int pageNum) {
        this.pageNum = pageNum;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }
}
